<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/echars.js"></script>
    <script src="./js/jquery.min.js"></script>
    <!-- 要在 echarts之下 -->
    <script src="./theme/purpleTheme.js"></script>
    <style>
        *{
            margin: 0 auto;
            padding: 0;
        }

        .chart {
            width: 400px;
            height: 400px;
        }
    </style>
</head>
<body>
    <div class="chart line"></div>
    <div class="chart pie"></div>
    <script>
        $(function() {
            (function() {
                echarts.init($('.chart')[0], 'purpleTheme').setOption({
                    legend:{
                        show: true,
                    },
                    xAxis: {
                        data: ['计算机网络', '网络安全', '网络维护', '计算机编程', '写代码'],
                    },
                    yAxis: {
                        type: 'value',
                        axisLabel: {
                            show: true,
                        }
                    },
                    series: [{
                        name: '1',
                        type: 'pie',
                        stack: '001',
                        data: [12,43,54,13,54],
                        color: ['black', 'green', 'blue', 'yewllow', 'preple'],
                    }, 
                    // {
                    //     name: '2',
                    //     type: 'line',
                    //     stack: '001',
                    //     data: [12,43,54,13,54],
                    // }
                ]
                });
            })();
            
        })
        // (function() {
        //     echarts.init($('.pie')[0]).setOption({
        //         series: [{
        //             type: 'pie',
        //             data: [12,43,54,13,54],
        //         }]
        //     })
        // })
    </script>
</body>
</html>